import request from '@/utils/request'
/**
 *
 * 获取部门列表
 */
export const reqGetDepartment = () => {
  return request({
    method: 'GET',
    url: '/company/department'
  })
}

/**
 *
 * 删除部门列表
 */
export const reqDelDepartment = (id) => {
  return request({
    method: 'DELETE',
    url: `/company/department/${id}`
  })
}

/**
 *
 * 新增部门列表
 */
export const reqAddDepartment = (data) => {
  return request({
    method: 'POST',
    url: '/company/department',
    data
  })
}

/**
 * 根据id查询部门详情
 * @param {*} id
 *
 */
export const reqGetDepartDetail = id =>
  request({
    method: 'GET',
    url: `/company/department/${id}`
  })

/**
   * 根据ID修改部门详情
   * @param {*} form
   *
   */
export const reqEditDepart = form =>
  request({
    method: 'PUT',
    url: `/company/department/${form.id}`,
    data: form
  })
